//Copyright 2011 - Jonathan Allen

using System;
using System.Collections.Generic;
using System.Linq;

namespace Granite
{
#if SILVERLIGHT || XBOX360
    /// <summary>
    /// This is an ArgumentOutOfRangeException that includes the actual value
    /// </summary>
    public class AnnotatedArgumentOutOfRangeException : ArgumentOutOfRangeException
    {

        readonly object m_ActualValue;

        /// <summary>
        /// Creates a AnnotatedArgumentOutOfRangeException
        /// </summary>       
        public AnnotatedArgumentOutOfRangeException(string paramName, object actualValue, string message)
            : base(paramName, message)
        {
            m_ActualValue = actualValue;

        }

        /// <summary>
        /// Creates a AnnotatedArgumentOutOfRangeException
        /// </summary>       
        public AnnotatedArgumentOutOfRangeException() { }

        /// <summary>
        /// Creates a AnnotatedArgumentOutOfRangeException
        /// </summary>       
        public AnnotatedArgumentOutOfRangeException(string paramName)
            : base(paramName) { }

        /// <summary>
        /// Creates a AnnotatedArgumentOutOfRangeException
        /// </summary>       
        public AnnotatedArgumentOutOfRangeException(string paramName, string message)
            : base(paramName, message) { }

        /// <summary>
        /// Creates a AnnotatedArgumentOutOfRangeException
        /// </summary>       
        public AnnotatedArgumentOutOfRangeException(string message, Exception innerException)
            : base(message, innerException) { }


        /// <summary>
        /// Gets the argument value that causes this exception.
        /// </summary>
        public object ActualValue
        {
            get { return m_ActualValue; }
        }
    }
#endif
}
